import { Injectable } from '@angular/core';
import { RequestClass } from './request.service';
@Injectable()
export class WarnService {
    constructor(private requestclass: RequestClass) {}
    fetchWarnInfoByConfig = async ({
        well_name,
        status,
        warn_code,
        startTime,
        endTime,
    }) => {
        return await this.requestclass.request.get('/warn/findwarninfo', {
            params: {
                well_name,
                status,
                warn_code,
                startTime,
                endTime,
            },
        });
    };

    // 报警状态修改
    // http://115.157.195.222:3000/project/16/interface/api/64
    updateWarnIdById = async ({ id, status, well_id }) => {
        return await this.requestclass.request.put('/warn/updatewarn', {
            data: {
                id,
                status,
                wellId: well_id,
            },
        });
    };
}
